FROM python:3.9.5-buster

USER root

RUN printf "\
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free \n\
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free \n\
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free \n\
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free \n\
    " > /etc/apt/sources.list && \
    DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y sudo --option=Dpkg::Options::=--force-confdef

RUN sudo apt update -qq && \
    sudo apt install -y --no-install-recommends vim curl git

RUN pip install -U pip -i https://pypi.tuna.tsinghua.edu.cn/simple

RUN cd ~ && \
    git clone https://gitee.com/xz2000/Movie-Recommendation-System-Web-Application.git --depth=1 && \
    cd ~/Movie-Recommendation-System-Web-Application && \
    pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

WORKDIR /root/Movie-Recommendation-System-Web-Application/MovieRecommendationApp/
CMD python3 manage.py runserver 0.0.0.0:8000
